package com.xt.core.helper;

import java.util.Comparator;


/**
 * compare string, used for sorted map or set
 * 
 * @author xiaotao
 * @version Revision: 1.0, Date: 14.10.2009
 */
public class StrComparator implements Comparator  {  
	public int compare(Object o1, Object o2) {
		String s1 = (String) o1;
		String s2 = (String) o2;
		return s1.toUpperCase().compareTo(s2.toUpperCase());
	}

	public boolean equals(Object o) {
		return compare(this, o) == 0;
	}  
}  

	
